package com.example.backend.controler;

import com.alibaba.fastjson.JSONObject;
import com.example.backend.pojo.BigType;
import com.example.backend.pojo.Product;
import com.example.backend.service.Product.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProductController {
    @Autowired
    ProductService productService;
    @RequestMapping("/product/findSwiper/")
    public List<Product> getSwiper(){
        return productService.findSwiper();
    }

    @GetMapping("/product/findHot/")
    public JSONObject getIsHot(){
        return productService.findHot(1);
    }

    @GetMapping("/product/findCategories/")
    public List<BigType> getCategories(){
        return productService.findCategories();
    }
}
